package com.github.tangyi.api.user.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.github.tangyi.common.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;

/**
 * 学生学习时长记录表 sys_student_study_log
 */
@Data
@Table(name = "sys_student_study_log")
@EqualsAndHashCode(callSuper = true)
public class SysStudentStudyLog extends BaseEntity<SysStudentStudyLog> {

    /**
     * 日志类型
     */
    @Column(name = "type")
    private Integer type;

    /**
     * 日志标题
     */
    @Column(name = "title")
    private String title;

    /**
     * 操作用户的 IP 地址
     */
    @Column(name = "ip")
    private String ip;

    /**
     * 操作用户代理信息
     */
    @Column(name = "user_agent")
    private String userAgent;

    /**
     * 课程 ID
     */
    @Column(name = "course_id")
    private String courseId;

    /**
     * 学习时长
     */
    @Column(name = "duration")
    private String duration;

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getType() {
        return type;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getIp() {
        return ip;
    }

    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }

    public String getUserAgent() {
        return userAgent;
    }

    public void setCourseId(String courseId) {
        this.courseId = courseId;
    }

    public String getCourseId() {
        return courseId;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public String getDuration() {
        return duration;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
